home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / test / locale / old / Catcomp.doc next >
Encoding:
Text File  |  1994-06-10  |  28.7 KB  |  789 lines

  1.  
  2.                   $VER: CatComp_Documentation 39.3 (22.9.92)
  3.                   ==========================================
  4.  
  5. CatComp is a program to handle the creation and maintenance of the message
  6. catalogs used by locale.library. Message catalogs are IFF files read by
  7. locale.library that contain all the text strings used by an application. By
  8. providing several of these catalog files, an application can use
  9. locale.library and transparently adapt itself to the user's preferred language.
  10.  
  11. CatComp reads and processes two kinds of input files, and produces five types
  12. of output files.
  13.  
  14. The first kind of file read by CatComp is a catalog description file. That
  15. file describes all the strings used by an application. There is one such file
  16. per localized application. In this file, you assign numbers to all the
  17. application strings as well as specify their minimum and maximum lengths.
  18.  
  19. The second kind of file read by CatComp is a catalog translation file. That
  20. file contains all strings from the application translated to one language.
  21. There is one catalog translation file per language supported by a localized
  22. application.
  23.  
  24. CatComp can produce five different kinds of output files. The first is an IFF
  25. catalog. These are regular IFF files. There is one catalog produced for every
  26. catalog text file successfully processed. Catalogs are read directly by
  27. locale.library whenever the OpenCatalog() call is made.
  28.  
  29. The second type of file output by CatComp is an empty translation file. This
  30. is useful when starting a translation. It lets CatComp convert a catalog
  31. description file into a ready to fill-in translation file.
  32.  
  33. The third and fourth type of files output by CatComp are C and Assembly
  34. language programming source files. These are used by application writers to
  35. convert catalog description files into source files that can be directly used
  36. in their applications.
  37.  
  38. Finally, the fifth type of file output by CatComp is an AmigaDOS load file.
  39. These load files are used by application writers to include a set of strings
  40. directly inside an application. This is normally used to encode the default
  41. strings that an application uses when there are no external catalogs available.
  42.  
  43.  
  44. Invoking CatComp
  45. ----------------
  46.  
  47. CatComp can only by run from the Shell under Kickstart V37 or beyond. Its
  48. template is:
  49.  
  50.   DESCRIPTOR/A,TRANSLATION,CATALOG/K,CTFILE/K,CFILE/K,ASMFILE/K,OBJFILE/K,
  51.   SYMBOLS/M/K,VB=VERBOSITY/N/K,NOOPTIM/S
  52.  
  53.   DESCRIPTOR/A
  54.   Specifies the name of a catalog description file. Typically, the file
  55.   extension for catalog description files is .cd
  56.  
  57.   TRANSLATION
  58.   Specifies the name of a catalog translation file. Typically, the
  59.   file extension for catalog translation files is .ct
  60.  
  61.   CATALOG/K
  62.   Specifies the name of the IFF catalog file to produce. When this option
  63.   is specified, a translation file must have been given in the previous
  64.   argument.
  65.  
  66.   CTFILE/K
  67.   Specifies the name of the blank catalog translation file to produce. This
  68.   option only requires a catalog descriptor file be provided, there is no need
  69.   for a translation file.
  70.  
  71.   CFILE/K
  72.   Specifies the name of the C-language source file header to produce. This
  73.   option only requires a catalog descriptor file be provided, there is no need
  74.   for a translation file.
  75.  
  76.   ASMFILE/K
  77.   Specifies the name of the Assembly-language source file header to produce.
  78.   This option only requires a catalog descriptor file be provided, there is
  79.   no need for a translation file.
  80.  
  81.   OBJFILE/K
  82.   Specifies the name of the AmigaDOS binary object file to produce.
  83.   This option only requires a catalog descriptor file be provided, there is
  84.   no need for a translation file.
  85.  
  86.   SYMBOLS/M/K
  87.   Specifies any number of symbols that are used to determine which section
  88.   of the available strings get included within an object file generated with
  89.   the OBJFILE option.
  90.  
  91.   VERBOSITY/N/K
  92.   Specifies the amount of information CatComp should output while doing some
  93.   processing. The lower this number, the less CatComp will output messages.
  94.   Not providing this option causes CatComp to output every message it could.
  95.  
  96.   NOOPTIM/S
  97.   When generating a catalog file, CatComp normally skips strings that are
  98.   identical in the catalog descriptor file and in the catalog translation
  99.   file and does not include them in the generated catalog file. This
  100.   option disables this optimization.
  101.  
  102.  
  103. Catalog Description Files
  104. -------------------------
  105.  
  106. Catalog description files completely describe the strings used by an
  107. application. The format for these files is basically a series of two line
  108. entries separated by an arbitrary number of comment lines. The EBNF (Extended
  109. Backus Naur Formalism) specification for catalog description files is:
  110.  
  111. {# command}
  112. {; comment line}
  113. <string name> "(" [string id] "/" [min string len] "/" [max string len] ")"
  114. [string]
  115.  
  116. The first line indicates special commands that provide control over the
  117. generation of C, Assembly, and object files. See the section on C and Assembly
  118. source files below for further information.
  119.  
  120. <string name> is the symbolic name of the string. Following the name comes
  121. three optional numbers enclosed in parenthesis and separated with slashes. The
  122. first number specifies the string's ID value. This is the ID value used to
  123. request this string when using the GetCatalogStr() call in locale.library. The
  124. second number specifies the minimum length for the string, while the third
  125. number specifies the maximum string length.
  126.  
  127. The next line of an entry contains the actual string. Within the catalog
  128. description file, the strings are the same as the default strings built into
  129. the application. The strings can use standard C-language backslash ("\")
  130. escape sequences. If a string ends with a backslash character, this means
  131. that the next line in the file should be considered a continuation of the
  132. current line.
  133.  
  134. Finally, any string entry can be separated from other entries by comment
  135. lines. Comment lines start with a semicolon. There can be any number of
  136. comment lines between two entries. It is not allowed to put comment lines
  137. between the two lines of a same entry.
  138.  
  139. Here's an example of two strings in a catalog description file:
  140.  
  141. MSG_HELLO (0/4/50)
  142. This is a test string for the world to see
  143. ;
  144. MSG_BYE (1/14/47)
  145. This is another test string
  146.  
  147. The first string is called MSG_HELLO, has 0 as ID value, can be as short
  148. as 4 characters and as long as 50. The string actually associated with the
  149. name follows on the next line. Then comes a comment line. Following that is
  150. the definition of the second string called BYE_WORLD_STR that has 1 as ID
  151. value, can be as short as 14 characters and as long as 47.
  152.  
  153. As mentioned above, all three numbers in an entry are optional. If the string
  154. id number is not specified, then the same id as the previous string in the
  155. file plus one is used. If the first string defined has no id value, the
  156. starting id value is 0. If the minimum string length is not specified, it is
  157. assumed to be 0. And finally, if the maximum string length is not specified,
  158. it is assumed to be unlimited.
  159.  
  160. All three numbers can be provided in hexadecimal by preceeding themby
  161. a $. For string IDs, it is also possible to specify a relative value. That
  162. is, by providing an ID value of "+1", you are telling CatComp to add one
  163. to the ID number this string was going to receive. This is useful over
  164. the course of evolution of a program, when certain strings need to be removed.
  165. An example would be:
  166.  
  167. MSG_HELLO (0/4/50)
  168. This is a test string for the world to see
  169. ;
  170. MSG_BYE (+1/14/47)
  171. This is another test string
  172. ;
  173. MSG_WELCOME (//)
  174. This is still a test string!
  175.  
  176. In this case, MSG_HELLO would have the value 0, MSG_BYE the value 2,
  177. and MSG_WELCOME the value 3.
  178.  
  179. A note on style here. It is relatively important to choose descriptive
  180. symbolic names for the strings. These names will be viewed by the translators
  181. and should be as meaningful as possible. The following conventions are
  182. suggested:
  183.  
  184.   - List all names in capital letters. This will make it clear they are
  185.     constants as this is the convention used in all Amiga include files.
  186.  
  187.   - Prefix each name with the string MSG_. This will make it clear to the
  188.     programmer that a given constant is in fact a string ID value.
  189.  
  190.   - Append the string _GAD to strings that are used for gadget labels.
  191.  
  192.   - Append the string _MENU to strings that are used for menu titles. For
  193.     example, MSG_EDIT_MENU.
  194.  
  195.   - Expand the path leading to a menu item when specifying strings that are
  196.     used for menu items. For example, for the Cut item in the Edit menu
  197.     would be written as MSG_EDIT_CUT.
  198.  
  199.  
  200. Catalog Translation Files
  201. -------------------------
  202.  
  203. Catalog translation files contain all the strings of an application translated
  204. to a different language than the default. The files look very similar to
  205. catalog description files, except they do not include the string id, minimum
  206. string length and maximum string length specifications. The EBNF specification
  207. for catalog translation files is:
  208.  
  209. {# command}
  210. {; comment line}
  211. <string name>
  212. [string]
  213.  
  214. The first line indicates special commands that describe attributes of the
  215. catalog file. There are currently five supported commands. "version" lets you
  216. specify a 2.0-style version string for the catalog. "language" lets you list
  217. the language that this catalog is in. This string should itself be in the
  218. given language and not in English. "codeset" lets you specify which code set
  219. this catalog requires. This value should currently always be 0. "rcsid" lets
  220. you specify a version string using the standard RCS method. That way, versions
  221. of catalogs can get updated automatically by RCS. The format for the rcsid
  222. command is:
  223.  
  224.   ## rcsid $Date: 1994/06/10 18:13:08 $ $Revision: 30.0 $
  225.  
  226. For example:
  227.  
  228.   ## rcsid $Date: 1994/06/10 18:13:08 $ $Revision: 30.0 $
  229.  
  230. The last command supported is "name" which can be used in conjunction with the
  231. "rcsid" command to specify the name component of a 2.0 version string. That is:
  232.  
  233. ## rcsid $Date: 1994/06/10 18:13:08 $ $Revision: 30.0 $
  234. ## name myprogram.catalog
  235.  
  236. The above will embed "$VER: myprogram.catalog 39.1 (31.7.92)" inside of the
  237. message catalog. Another example:
  238.  
  239. ## version $VER: myprogram.catalog 39.1 (31.7.92)
  240. ## codeset 0
  241. ## language francais
  242. ;
  243. MSG_HELLO
  244. Ceci est une chaine test pour ĂȘtre vue
  245. ;
  246. MSG_BYE
  247. Ceci est une autre chaine test
  248.  
  249. The first three lines are command lines. The following line is a comment line
  250. as it starts with a semicolon. The following line you list the symbolic name
  251. of the string, and on the second line the translated string. If a string ends
  252. with a backslash character, this means that the next line in the file should
  253. be considered a continuation of the current line.
  254.  
  255. The symbolic name is the same as the related entry in the catalog description
  256. file. CatComp uses this name to associate entries from translation files with
  257. entries in description files. It can then validate the strings in the
  258. translation files by ensuring they are of the correct length, etc.
  259.  
  260.  
  261. Escape Sequences Supported
  262. --------------------------
  263.  
  264. Regular C-language escape sequences can be specified in strings, along with a
  265. few additions:
  266.  
  267.   \a    inserts an audible bell character (ASCII 7)
  268.   \b    inserts a backspace character (ASCII 8)
  269.   \c    inserts a control sequence introducer (ASCII 155)
  270.   \e    inserts an escape character (ASCII 27)
  271.   \f    inserts a formfeed character (ASCII 12)
  272.   \n    inserts a newline character (ASCII 10)
  273.   \r    inserts a carriage return character (ASCII 13)
  274.   \t    inserts a tab character (ASCII 9)
  275.   \v    inserts a vertical tab character (ASCII 11)
  276.   \xNN  inserts NN, where NN specifies an ASCII code in hexadecimal
  277.   \NNN  inserts NNN, where NNN specifies an ASCII code in octal
  278.  
  279. As well, when any string line within a description or translation file ends
  280. with a backslash ("\"), it means that the following line within the file is
  281. to be considered a continuation of the current line.
  282.  
  283.  
  284. Formatted Output Commands
  285. -------------------------
  286.  
  287. CatComp parses strings for C-language formatting commands as used in the
  288. printf() function. It ensures that the number and type of such commands are
  289. the same in both the description file and the translation files. This
  290. guarantees that the application stack frame will not be misinterpreted due to
  291. incorrect translations of formatting commands.
  292.  
  293. CatComp warns you if you attempt to use any non-C formatting commands. The
  294. commands that CatComp does understand are:
  295.  
  296.     %b  %c  %d  %e  %E  %f  %g  %G  %i  %o  %p  %s  %u  %x  %X  %N  %T
  297.  
  298. CatComp also knows about the ordering formatting command supported by
  299. RawDoFmt() whenever locale.library runs in the system, or by locale's
  300. FormatString() routine. The ordering command lets you specify formatting
  301. commands within a formatting string in a different order than in the original
  302. string, while still accessing the stack frame correctly. CatComp validates the
  303. ordering information and ensures argument types match. See the documentation
  304. locale.library/FormatString().
  305.  
  306. Specifying the argument position lets the order of the % commands within your
  307. strings without affecting how the program performs. Given a string in a
  308. catalog description file such as:
  309.  
  310. MSG_AVAIL_MEM (//)
  311. FAST: %lU, GRAPHIC: %lU
  312.  
  313. This string could be translated in French as:
  314.  
  315. MSG_AVAIL_MEM (//)
  316. GRAPHIQUE: %2$lU, AUTRE %1$lU
  317.  
  318. Using the first string, the output of the program might look like:
  319.  
  320. FAST: 1234, GRAPHIC: 5678
  321.  
  322. while the translation would output:
  323.  
  324. GRAPHIQUE: 5678, AUTRE: 1234
  325.  
  326.  
  327. Validation
  328. ----------
  329.  
  330. CatComp enforces the syntax of catalog description files and catalog
  331. translation files very strongly. It also ensures that the same number of
  332. C-language % command appear in both the description and the translation file.
  333. This guarantees the integrity of the application stack-frame when using
  334. translated string in printf() statements.
  335.  
  336. Most errors detected by CatComp are fatal and cause the program to abort.
  337. Errors are reported to the console with a descriptive error message, a
  338. filename, and if needed a line and column number. Non-fatal errors (warnings)
  339. and also sent to the console, but they do not cause the program to abort. The
  340. printing of these warning messages can be suppressed using the VERBOSITY
  341. command-line option.
  342.  
  343.  
  344. Possible Errors
  345. ---------------
  346.  
  347. Here is a list of the errors and warnings that CatComp can produce, along with
  348. an explanation of what went wrong. Most errors indicate the file, line and
  349. column where the error occurred to help in solving the problem. Note that when
  350. using strings with the line continuation character ("\"), the line numbers
  351. printed will refer to the last line of the strings, even though the error
  352. may be in the first line.
  353.  
  354. ERROR: string line for token <name> not found
  355.   A given token was not followed by a string
  356.  
  357. ERROR: token not found
  358.   No token was found on a line in a catalog description file. Comment lines
  359.   must start with ";", any other line must have a valid token definition on
  360.   it.
  361.  
  362. ERROR: '(' expected
  363.   There was no number section after a token in a catalog description file.
  364.   The number section must start with a (, followed by three optional numbers
  365.   separated by slashes, and terminated by a ).
  366.  
  367. ERROR: ')' expected
  368.   There was no ) after a number section in a catalog description file.
  369.   The number section must start with a (, followed by three optional numbers
  370.   separated by slashes, and terminated by a ).
  371.  
  372. ERROR: '/' expected
  373.   There was no slash found within a number section after a token in a catalog
  374.   description file. The number section must start with a (, followed by three
  375.   optional numbers separated by slashes, and terminated by a ). So there
  376.   must always be two slashes specified.
  377.  
  378. ERROR: garbage characters after token <name>
  379.   There was no number section after a token in a catalog description file,
  380.   and garbage characters were found instead, The number section must start
  381.   with a (, followed by three optional numbers separated by slashes, and
  382.   terminated by a ).
  383.  
  384. ERROR: <name> is not a valid token
  385.   A token in a catalog description file was composed of invalid characters.
  386.   A token must start with a letter and can be followed by letters, numbers and
  387.   underscores.
  388.  
  389. ERROR: token <name> not found
  390.   A token specified in a catalog description file was not present in
  391.   a translation file
  392.  
  393. ERROR: string too short for token <name>
  394.   A string in a translation file is shorter than the minimum length
  395.   specified in the description file.
  396.  
  397. ERROR: string too long for token <name>
  398.   A string in a translation file is shorter than the minimum length
  399.   specified in the description file.
  400.  
  401. ERROR: negative value for minimum length
  402.   The minimum string length specified for a token must be positive.
  403.  
  404. ERROR: negative value for maximum length
  405.   The maximum string length specified for a token must be positive.
  406.  
  407. ERROR: non-positive value for % ordering
  408.   The position information for a % formatting command must be positive and
  409.   greater than 1.
  410.  
  411. ERROR: % ordering value too large
  412.   The position information for a % formatting command is greater than the
  413.   number of formatting commands provided
  414.  
  415. ERROR: % size incorrect
  416.   The size specifier for a % formatting command in a translation file does
  417.   not match the size in the description file.
  418.  
  419. ERROR: % command does not match
  420.   The type specifier for a % formatting command in a translation file does
  421.   not match the size in the description file.
  422.  
  423. ERROR: token <name> defined multiple times
  424.   A token was defined multiple times in either a description or a translation
  425.   file.
  426.  
  427. ERROR: id <number> already used for token <name>
  428.   An attempt was made to reuse an ID value twice within a description file
  429.  
  430. ERROR: no command found after '#'
  431.   Command lines start with # and are followed by a command.
  432.  
  433. ERROR: <name> is not a valid command after '#'
  434.   A command specified after # is invalid.
  435.  
  436. ERROR: <number> is not a valid codeset value
  437.   An incorrect codeset value was specified for a #codeset command.
  438.  
  439. ERROR: <string> is not a valid rcsid value
  440.   A string in an incorrect format was specified for an #rcsid command.
  441.   The format expected is
  442.   ## rcsid $Date: 1994/06/10 18:13:08 $ $Revision: 30.0 $
  443.  
  444. ERROR: couldn't write catalog <name>
  445.   An error occurred while writing the catalog file
  446.  
  447. WARNING: <name> is an unknown formatting command
  448.   An unknown % formatting command was specified. CatComp knows only of
  449.   C-language formatting commands, anything else will be flagged
  450.   with this warning.
  451.  
  452. WARNING: string for token <name> matches string in descriptor
  453.   A string within a translation file matches exactly the original string
  454.   from the description file. This may mean that the string was not
  455.   translated. CatComp will not bother putting the string in any
  456.   generated catalog when this situation occurs, unless the NOOPTIM
  457.   command-line option is specified
  458.  
  459. WARNING: original string for token <name> had a trailing ellipsis (...)
  460.   The original string in the catalog descriptor file had a trailing
  461.   ellipsis (such as "Open..."), but the translation did not.
  462.  
  463.  
  464. C and Assembly Source Files
  465. ---------------------------
  466.  
  467. CatComp has the ability to output C and Assembly language source file.
  468. The intent of this is to let application programmers manipulate a single
  469. catalog description file and have source files generated for them
  470. automatically so they can include the strings in their programs.
  471.  
  472. To generate these files, you need to give CatComp a descriptor file, and
  473. either a C or an Assembly output file name using the CFILE/K and ASMFILE/K
  474. command-line options. The resulting files will be standard C and/or Assembly
  475. source file that can be used easily in application code.
  476.  
  477. Both C and Assembly source files contain multiple sections. You can choose
  478. which sections of these files you want in your application by using standard
  479. conditional compilation symbol definitions. Here is a list of the various
  480. symbols and the type of data they hold:
  481.  
  482.   CATCOMP_NUMBERS
  483.   Defining this symbol causes the name of each string to be defined with the
  484.   value of its id, as listed in the catalog description file. So if the .cd
  485.   file contains a string such as:
  486.  
  487.       MSG_HELLO (141//)
  488.       Hello
  489.  
  490.   then the C file generated would have
  491.  
  492.       #define MSG_HELLO 141
  493.  
  494.   and for Assembly:
  495.  
  496.       MSG_HELLO EQU 141
  497.  
  498.   CATCOMP_STRINGS
  499.   Defining this symbol causes each string to be defined. Using the same
  500.   example as above, you would get the following for C:
  501.  
  502.       MSG_HELLO_STR "Hello"
  503.  
  504.   and for Assembly:
  505.  
  506.       MSG_HELLO_STR: DC.B 'Hello',$00
  507.  
  508.   CATCOMP_ARRAY
  509.   Causes a table of the following structures to become available:
  510.  
  511.       struct CatCompArrayType
  512.       {
  513.           LONG   cca_ID;
  514.           STRPTR cca_Str;
  515.       };
  516.  
  517.   cca_ID contains the id value of a string, and cca_Str points to the string
  518.   itself. By scanning this array, you can access all of the strings defined
  519.   for the application.
  520.  
  521.   CATCOMP_BLOCK
  522.   Causes a compact table of all the strings and their id values to be
  523.   generated. The format is:
  524.  
  525.       1 longword of string id
  526.       1 word of string length
  527.       string
  528.       ..etc...
  529.  
  530.   This type of table is difficult to parse in C, and generally better handled
  531.   in Assembly.
  532.  
  533.   CATCOMP_CODE
  534.   This causes the generation of source code for a function called GetString().
  535.   The function takes for argument an initialized LocaleInfo structure and a
  536.   string number. It returns a string pointer. The LocaleInfo structure is:
  537.  
  538.       struct LocaleInfo
  539.       {
  540.           APTR li_LocaleBase;
  541.           APTR li_Catalog;
  542.       }
  543.  
  544.   li_LocaleBase should be initialized to the return value of
  545.   OpenLibrary() of locale.library, or NULL if the library can't be opened.
  546.   li_Catalog should be initialized to the result of OpenCatalog() of the
  547.   application's catalog. This value can be NULL.
  548.  
  549. Special commands can be embedded in catalog description files to provide
  550. control over the generation of header files. These commands are introduced
  551. by a # symbol within the catalog description file. The supported commands
  552. are:
  553.  
  554.   #header <header name>
  555.   This lets you indicate the base name of the header files being produced.
  556.   The base name is then used as the top of header files. For example:
  557.  
  558.       #header TEXTTABLE
  559.  
  560.       would cause the following to be added at the start of the C header file:
  561.  
  562.       #ifndef TEXTTABLE_H
  563.       #define TEXTTABLE_H
  564.  
  565.   #array <array base name>
  566.   This lets you specify the base name of the arrays generated in the header
  567.   files being produced. The default is "CatCompArray"
  568.  
  569.   #block <block base name>
  570.   This lets you specify the base name of the data block generated in the header
  571.   files being produced. The default is "CatCompBlock"
  572.  
  573.   #arrayopts <compiler options>
  574.   This lets you specify which compiler option should be used when
  575.   generating arrays of data. The default is "static const".
  576.  
  577.   #function <function name>
  578.   This lets you specify the name of the function that is generated.
  579.   The default is "GetString"
  580.  
  581.   #ifdef <symbol name>
  582.   Causes CatComp to enclose the following identifiers within a conditional
  583.   compilation block.
  584.  
  585.   #endif <symbol name>
  586.   Causes CatComp to terminate the current conditional compilation block.
  587.  
  588.   #lengthbytes <number of bytes>
  589.   Causes CatComp to precede every following strings with 'n' bytes of length
  590.   information. The default number of bytes is 0. The
  591.   locale.library/GetCatalogStr() function will then return a pointer
  592.   to the length bytes, followed by the actual string. The length
  593.   indicated does NOT include the length bytes themselves.
  594.  
  595.  
  596. Sample Use
  597. ----------
  598.  
  599. This section presents sample uses of CatComp with example command-lines.
  600.  
  601. Assume you have a catalog description file for an application called "app.cd".
  602.  
  603.  
  604. To test if this file is a valid .cd file, type:
  605.  
  606.   CatComp app.cd
  607.  
  608. and CatComp will respond with either some error messages, or with a message
  609. saying that 'app.cd' is a valid descriptor file.
  610.  
  611.  
  612. To do a translation of a .cd file, you need a .ct file. Such a file can be
  613. generated by doing:
  614.  
  615.   CatComp app.cd CTFILE app.ct
  616.  
  617. This will create a blank translation file called app.ct. You can then load
  618. app.ct in a standard text editor and proceed to translate the strings it
  619. contains.
  620.  
  621. Once a .ct file is done being translated, it must be converted in an IFF
  622. catalog file. This is done by doing:
  623.  
  624.   CatComp app.cd app.ct CATALOG app.catalog
  625.  
  626. This will create a file called app.catalog.
  627.  
  628.  
  629. See the accompanying HelloWorld program for a complete example of a localized
  630. program using the efficient CATCOMP_CODE approach.
  631.  
  632.  
  633. Revision Information
  634. --------------------
  635.  
  636. CatComp 38.2
  637.   - Initial release
  638.  
  639. CatComp 38.7
  640.  
  641.   - No longer complains that %N and %T are unknown formatting commands
  642.     (for support of BCPL strings)
  643.  
  644.   - Added documentation of the # commands for .cd and .ct files
  645.  
  646.   - Added new .cd file command: #header. Lets you specify the base name
  647.     of the header file being generated. The name is used in the #ifdef
  648.     statements at the start of generated C and ASM header files.
  649.  
  650. CatComp 38.8
  651.  
  652.   - Added new .cd file command: #lengthbytes. Lets you specify the number
  653.     of length bytes to put in front of strings in locale catalogs. The
  654.     default number of bytes is 0. See doc file for more info. This is
  655.     needed for Installer localization.
  656.  
  657. CatComp 38.9
  658.  
  659.   - Now puts an #ifndef around the #include statements in the generated
  660.     C header files to avoid nested includes
  661.  
  662. CatComp 38.10
  663.  
  664.   - Fixed bug with not initializing a variable on the stack upon startup.
  665.     Worked fine under WShell since it allocates the stack as MEMF_CLEAR,
  666.     failed under AmigaShell.
  667.  
  668.   - Fixed bug with processing translation files with empty strings in them
  669.  
  670. CatComp 38.11
  671.  
  672.   - Now supports multi-line strings using standard C line continuation
  673.     notation (\ at EOL)
  674.  
  675. CatComp 38.15
  676.  
  677.   - Fixed assembly source file output. It was including an extraneous
  678.     character at the start of the header files
  679.  
  680. CatComp 38.16
  681.  
  682.   - Now reports a warning when an original string contains a trailing ...
  683.     and a translated one doesn't. Output of the warning can be controlled by
  684.     the VERBOSITY command-line option
  685.  
  686. CatComp 38.17
  687.  
  688.   - Added NOOPTIM command-line option to disable string optimization. This
  689.     is needed in certain cases.
  690.  
  691. CatComp 38.18
  692.  
  693.   - Typecast strings to (STRPTR) in the generated C headers in order to
  694.     keep folks compiling with strict ANSI and signed characters happy.
  695.  
  696. CatComp 38.19
  697.  
  698.   - Added the #array command that can be specified in .cd files. This is in
  699.     support of multi-catalog applications (specifically for AppShell). See
  700.     CatComp.doc for details.
  701.  
  702. CatComp 38.20
  703.  
  704.   - Fixed incorrect handling of return value for calls to StrToLong(). This
  705.     problem showed up with the latest DOS.
  706.  
  707. CatComp 38.21
  708.  
  709.   - Fixed another problem with the new behavior of StrToLong()
  710.  
  711. CatComp 38.22
  712.  
  713.   - The string ID, min length and max length values specified in .cd
  714.     files can now be in hex, by putting a $ in front of them.
  715.  
  716.   - A string ID can now be specified as relative to the previous strings ID
  717.     by putting a + in front of the number. So +1 as a string ID means to add
  718.     one of the string ID. This is useful when deleting obsolete strings
  719.  
  720. CatComp 38.23
  721.  
  722.   - Two new commands can now be specified in a .ct file:
  723.  
  724.     ##rcsid
  725.  
  726.     Lets you embed an RCS-style version string. As the catalog is processed,
  727.     the version string is converted to an AmigaDOS-style version string
  728.     and inserted into the generated catalog. This eliminates the need to
  729.     update version strings in catalogs by hand, since RCS can now do it for
  730.     you. All the V39 catalog files have been updated to use this new feature.
  731.  
  732.     ##name
  733.  
  734.     Lets you specify the name component of a version string, since this cannot
  735.     be done in the ##rcsid command. If the name component is not specified,
  736.     then the current output filename is used.
  737.  
  738. CatComp 38.25
  739.  
  740.   - After almost 3 whole days of looking for a bug which was causing
  741.     random memory to be trashed, the problem was found. Starting with
  742.     version 38.23, CatComp was being linked with the SAS version of the
  743.     sprintf() function. This function pokes random memory! DO NOT USE!
  744.     Switching to use the amiga.lib sprintf() cure everything.
  745.  
  746.   - Now uses SetVBuf() to speed up its IO.
  747.  
  748.   While looking for the above memory trash problem, a few other problems came
  749.   to light
  750.  
  751.   - Memory allocated for .ct files was not being freed if no .catalog was
  752.     being generated.
  753.  
  754.   - A small amount of memory was not being freed if there was a #ifdef
  755.     without a matching #endif in a .cd file
  756.  
  757.   - % commands were not processed in strings containing a NULL ( \0 ) in both
  758.     .cd and .ct files
  759.  
  760.   - Now handles the documented bug in FGets() under V37 by allocating a buffer
  761.     1 byte larger than it needs to be
  762.  
  763. CatComp 39.1
  764.  
  765.   - Added generation of the STRINGBLOCK sections in .h and .i files
  766.  
  767.   - Added generation of object files
  768.  
  769.   - Cleaned up source file generation. New consistent conditional statement
  770.     names allow full control of what does and does not get included for
  771.     both C and ASM source files
  772.  
  773.   - Added #arrayopts command to define which compiler options are used when
  774.     declaring arrays
  775.  
  776.   - Added #block command to define the name of the data block generated
  777.     when CATCOMP_BLOCK is defined.
  778.  
  779.   - Added #function command to define the name of the function generated
  780.     when CATCOMP_CODE is defined.
  781.  
  782. CatComp 39.2
  783.  
  784.   - Made symbol names case-insensitive
  785.  
  786. CatComp 39.3
  787.  
  788.   - Corrected array type to struct CatCompArrayType
  789.